stylecontext: Deprecate gtk_style_context_get_font()
authorBenjamin Otte <otte@redhat.com>
Thu, 6 Dec 2012 01:55:22 +0000 (02:55 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 6 Dec 2012 01:57:19 +0000 (02:57 +0100)
This is for a very simple reason: The getter is returning a const value
and the font isn't const anymore. So we need to store the font
description somewhere but we can't reuse it as it's changing all the
time (yay animations, yay inherited values). Sucks.

So keep the hack in here but deprecate the function.

gtk/gtkstylecontext.c
gtk/gtkstylecontext.h
gtk/gtkthemingengine.c
gtk/gtkthemingengine.h

index fbd8e1717f64873216923cacb49632dff6504693..8c99d8f26f63be0a9c74062a2aed749b8bf244a7 100644 (file)
@@ -3468,6 +3468,9 @@ gtk_style_context_get_margin (GtkStyleContext *context,
  *          freed.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: Use gtk_style_context_get() for "font" or
+ *     subproperties instead.
  **/
 const PangoFontDescription *
 gtk_style_context_get_font (GtkStyleContext *context,
index 8731cba327b9d541ee8b9d09270e5a4059c9b700..3d79c651b80acd30fad54586c1acc44d3f4beeaa 100644 (file)
@@ -879,6 +879,8 @@ void gtk_style_context_get_background_color (GtkStyleContext *context,
 void gtk_style_context_get_border_color     (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GdkRGBA         *color);
+
+GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get)
 const PangoFontDescription *
      gtk_style_context_get_font             (GtkStyleContext *context,
                                              GtkStateFlags    state);
index 409e34d1f0b1be6a6c6f90a0ecf5b4f081df7b7b..7930760fd9c5ff9cdb3658ee6713e41f519b4b78 100644 (file)
@@ -853,6 +853,8 @@ gtk_theming_engine_get_margin (GtkThemingEngine *engine,
  *          freed.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: Use gtk_theming_engine_get()
  **/
 const PangoFontDescription *
 gtk_theming_engine_get_font (GtkThemingEngine *engine,
@@ -862,8 +864,10 @@ gtk_theming_engine_get_font (GtkThemingEngine *engine,
 
   g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), NULL);
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   priv = engine->priv;
   return gtk_style_context_get_font (priv->context, state);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 /* GtkThemingModule */
index 0bdc3a13cfcbe1fdaececeac7ae670efaf19ac46..13e1927c7e3c3a59367dd28ffce119654634f8bb 100644 (file)
@@ -249,6 +249,7 @@ void gtk_theming_engine_get_margin  (GtkThemingEngine *engine,
                                      GtkStateFlags     state,
                                      GtkBorder        *margin);
 
+GDK_DEPRECATED_IN_3_8_FOR(gtk_theming_engine_get)
 const PangoFontDescription * gtk_theming_engine_get_font (GtkThemingEngine *engine,
                                                           GtkStateFlags     state);